package controllayer;
import modellayer.*;

/**
 * Write a description of class VareController here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class VareController
{
    private VareContainer vContainer;
    private static VareController instance;
    /**
     * Constructor for objects of class VareController
     */
    private VareController()
    {
        vContainer = vContainer.getInstance();
    }

    /**
     * Singleton for VareController.
     */
    public static VareController getInstance()
    {
        if(instance == null)
        {
            instance = new VareController();
        }

        return instance;

    }

    /**
     * Calls the method findVare on vContainer to search for a vare with the given string stregkode.
     * 
     * @param  stregkode  A string that is used to search for a Vare.
     * @return     An object vare, that was returned from the findVare method called.
     */
    public Vare findVare(String stregkode)
    {
        Vare search = vContainer.findVare(stregkode);
        return search;
    }

    //public void createVare(String beskrivelse, int indkobsrabat, int fastRabat, int vejledendeudsalgspris, int antalEksemplarer, String leverandor, String stregkode)
    //{
    //    Vare vare = new Vare(beskrivelse, indkobsrabat, fastRabat, vejledendeudsalgspris, antalEksemplarer, leverandor, stregkode);
    //    vContainer.addVare(vare);
    //}
}
